package cn.yuanqiao.archive.appManager.domain;/**
 * @author 赵常飞
 * @date 2023/8/3 11:01
 */

import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 *
 *@AUTHOR:赵常飞
 *@date 2023/8/3 11:01
 */
public class YqdaTreesrole extends BaseEntity {
    private final String BIGTABLENAME = "_TREESROLE";

    public YqdaTreesrole() {
        String tenantCode = SecurityUtils.getLoginUser().getUser().getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("TenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    private static final long serialVersionUID = 1L;
    private String tableName;

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long roleId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long menuId;

    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long treeId;

    public Long getTreeId() {
        return treeId;
    }

    public void setTreeId(Long treeId) {
        this.treeId = treeId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }
}
